import { Observer } from 'mobx-vue'
import { Component, Vue } from 'vue-property-decorator'
import { imagesOssPrefix } from "src/utils/ztbase";
// 接口
// import { activityList } from 'src/utils/axios'
@Observer
@Component({
  props: {
    clear: {
      type: Boolean,
      default: false
    }
  }
})

export default class ActivityDetail extends Vue {
  // 弹出层关闭
  isShowModel: boolean = false
  loading: boolean = true;
  //图片预览
  isImagePreview: boolean = false;
  detailInfo: any = {};
  showData: any = [];
  formItem: any = {
    id: '',
  };

  created() {
    let vm = this;
    vm.isShowModel = true;
    // vm.init()
  }

  // 弹出层关闭
  close() {
    let vm: any = this;
    let xwindow: any = window
    vm.isShowModel = false;
    if (!vm.clear) {
      xwindow.clearBodyStyle()
    }
    vm.$emit('close')
  }
  // 图片补齐域名
  imagePrefix(url, zoomScale) {
    return imagesOssPrefix(url, zoomScale)
  }
  //转化时间
  changeTime(val, isDate = false) {
    let xwindow: any = window
    if (isDate) {
      return xwindow.conversionTime.timeToYMd(val)
    }
    return xwindow.conversionTime.timeToYMdHms(val)
  }
}